package banking.domain;

public class Account {
	protected double balance;
	Account(double init_balance){
			balance=init_balance;
	}
	public  double getBalance() {
			return balance;
	}
	public boolean deposit(double amt) {
			balance=balance+amt;
			return true;
	}
	public void withdraw (double amt)throws  OverdraftException {
			if(amt>balance) {
					throw new  OverdraftException("Insufficient funds",amt-balance);
			}
			else {
					balance-=amt;
			}
	}
}
